package com.yunchao.maintenance.domain.repository

import com.yunchao.maintenance.domain.model.MaintenanceInfoModel
import kotlinx.coroutines.flow.Flow
import java.io.File

internal interface MaintenanceInfoRepository {

    suspend fun openDevice(): Result<Boolean>

    suspend fun closeDevice()

    suspend fun inventoryOnce(): Result<String>

    suspend fun inventoryAll(maintenanceInfoMap: Map<String,MaintenanceInfoModel>):  Flow<List<MaintenanceInfoModel>>

    //获取所有维保的Excel文件
    suspend fun getMaintenanceFileList(): Result<List<File>>

    //根据文件名获取维保信息列表并添加到数据库中
    suspend fun addMaintenanceInfoList(fileName: String): Result<Boolean>

    //根据锁号查询具体的维保信息
    suspend fun getMaintenanceInfoByLockNo(lockNo: String): Result<MaintenanceInfoModel?>


   suspend fun writeDataToExcel(models: List<MaintenanceInfoModel>): Result<Boolean>

}